# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=keycloak-config-cli
pkgver=5.10.0
pkgrel=0
pkgdesc="Configuration as Code for Keycloak"
url="https://github.com/adorsys/keycloak-config-cli"
arch="noarch !armhf !armv7 !riscv64 !x86"  # blocked by openjdk11+
license="Apache-2.0"
depends="java-jre-headless"
makedepends="maven openjdk11" # for build order resolution
source="https://github.com/adorsys/keycloak-config-cli/archive/v$pkgver/keycloak-config-cli-$pkgver.tar.gz
	keycloak-config-cli
	"
# !check: requires docker etc.
# net: downloads dependencies from Maven repositories
options="!check net"

# NOTE: Maven 3 dropped support for the M2_HOME variable.
export MAVEN_ARGS="--batch-mode -Duser.home=$srcdir/.home"

build() {
	mvn package -DskipTests=true
}

package() {
	install -D -m644 target/keycloak-config-cli.jar -t "$pkgdir"/usr/share/java/
	install -D -m755 "$srcdir"/keycloak-config-cli -t "$pkgdir"/usr/bin/
}

sha512sums="
1f73e820631354680c90d899c2e66bdf14c4e66a027011d39bde33c45888f11aaf5b4875812efed8d33013b9fa4b602048eef1dce01ed7dcaa33d6fc6d837e30  keycloak-config-cli-5.10.0.tar.gz
c8bb931165294fe8cb605e315f4d76ea5a6a6b31a70b5f57a06941c658e0ef17d9f4f0540ddf2ebe768398a91dbc80654be73f4d924b99acc23a11be4154c523  keycloak-config-cli
"
